package com.geek.gkfood.util.excp;

/**
 * <h1>异常编码。</h1><br/>
 *
 * <h1><br/><a href="https://u.geekbang.org/subject/arch3/100614201">Java 业务架构实战营：https://u.geekbang.org/subject/arch3/100614201</a></h1><br/><h1><a href="https://gitee.com/ylimhhmily/BizArchPracticeCamp">Java 业务架构实战营代码地址：https://gitee.com/ylimhhmily/BizArchPracticeCamp</a></h1><br/><h1><a href="https://u.geekbang.org/subject/java4th/1001148?source=app_share">高级 Java 工程体系课 2023 版：https://u.geekbang.org/subject/java4th/1001148?source=app_share</a></h1><br/><h1><a href="https://time.geekbang.org/column/intro/100312101?tab=catalog">Dubbo 源码剖析与实战：https://time.geekbang.org/column/intro/100312101?tab=catalog</a></h1>
 *
 * @author hmilyylimh
 * ^_^
 * @version 0.0.1
 * ^_^
 * @date 2022-02-18
 */
public enum GkFoodCodeEnum {

    /** <h2>"000000", "成功"</h2> */
    SUCCESS("000000", "成功"),

    /** <h2>"807001", "参数异常"</h2> */
    ARGS_ERROR("807001", "参数异常"),
    /** <h2>"807002", "插入数据异常"</h2> */
    INSERT_DATA_ERROR("807002", "插入数据异常"),
    /** <h2>"807003", "抢单失败"</h2> */
    SNATCH_ORDER_FAILED("807003", "抢单失败"),
    /** <h2>"807004", "获取序列号失败"</h2> */
    GET_SEQUENCE_FAILED("807004", "获取序列号失败"),
    /** <h2>"807005", "令牌无效"</h2> */
    INVALID_TOKEN("807005", "令牌无效"),

    /////////////////////////////////////

    /** <h2>"807994", "编译脚本异常"</h2> */
    COMPILE_SCRIPT_EXCEPTION("807994", "编译脚本异常"),
    /** <h2>"807995", "实例化Bean异常"</h2> */
    INITIALIZING_BEAN_EXCEPTION("807995", "实例化Bean异常"),
    /** <h2>"807996", "Redis的Lua脚本异常"</h2> */
    REDIS_LUA_EXCEPTION("807996", "Redis的Lua脚本异常"),
    /** <h2>"807997", "系统不支持"</h2> */
    UN_SUPPORT_EXCEPTION("807997", "系统不支持"),
    /** <h2>"807998", "限流异常"</h2> */
    LIMIT_EXCEPTION("807998", "限流异常"),
    /** <h2>"807999", "系统异常"</h2> */
    SYSTEM_EXCEPTION("807999", "系统异常"),

    ;

    private final String code;
    private final String msg;

    GkFoodCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
